package com.ktjy.factory;

import com.ktjy.dao.NewsDao;
import com.ktjy.dao.impl.NewsDapImpl;

public class SimpleDaoFactory {
    public static NewsDao getInstance(String key) {
        switch (key){
            case "mysql":
//                return new NewsDaoMySqlImpl();
            case "oracle":
//                return new NewsDapOracleImpl();
            case "redis":
//                return new NewsDapRedisImpl();
            default:
                throw new RuntimeException("无效的数据库类型：" + key + "，DAO获取失败");
        }
    }
}
